<template>
	<view class="certification-pages">
		<view class="info-block">
			<view class="form-block">
				<view class="form-item">
					<view class="name-item">
						<view class="name">头像</view>
					</view>
					<view class="user-photo-block">
						<view class="upload-photo-btn">
							<image :src="cloudStorage+form.avatar" class="user-photo ps" v-if="form.avatar"></image>
							<image src="https://suzhou-taxi-1306862033.cos.ap-chengdu.myqcloud.com/file/face.png"
								class="user-photo ps" v-else></image>
						</view>
					</view>
				</view>
				<view class="form-item">
					<view class="name-item">
						<view class="name">姓名</view>
					</view>
					<view class="input-item">
						<view>{{form.name}}</view>
						<!-- <view class="status">已实名</view> -->
					</view>
				</view>
				<!-- <view class="form-item">
					<view class="name-item">
						<view class="name">身份证号码</view>
					</view>
					<view class="text">{{form.idNumber}}</view>
				</view> -->
				<view class="form-item">
					<view class="name-item">
						<view class="name">手机号</view>
					</view>
					<view class="text">{{form.phone}}</view>
				</view>
				<view class="form-item">
					<view class="name-item">
						<view class="name">车牌号</view>
					</view>
					<view class="text">{{form.carNo}}</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import {
		validate,
		validateIdCard
	} from '@/util/validate.js';
	import {
		getStorage
	} from '@/util/auth.js';
	import {
		uploadImg
	} from '@/api/file.js';
	import {
		getUserInfoApi
	} from '@/api/user.js'
	export default {
		data() {
			return {
				form: {
					faceUrl: '',
					name: '朱瑞华',
					//idNumber: '622***********1222',
					phone: '182****2021',
					carNo: ''
				},
			}
		},
		methods: {
			getUser() {
				getUserInfoApi().then((res) => {
					this.form = res;
				});
			}
		},
		onLoad() {
			this.getUser()
		}
	}
</script>

<style lang="scss" scoped>
	.certification-pages {
		overflow: hidden;
		min-height: 100vh;
		background-color: #F8FBFF;

		.bg-img {
			width: 100%;
			height: 100%;
			position: absolute;
		}

		.info-block {
			position: relative;
			padding: 30rpx;

			.form-block {
				background-color: #FFF;
				border-radius: 30rpx;
				margin-top: 20rpx;
				padding: 30rpx;

				.form-item:last-child {
					border-bottom: none;
				}

				.form-item {
					width: 100%;
					display: flex;
					align-items: center;
					justify-content: space-between;
					line-height: 120rpx;
					font-size: 30rpx;
					border-bottom: 1px solid #F7F7F7;

					.name-item {
						display: flex;
						align-items: center;

						.must {
							color: #EA0000;
							margin-right: 4rpx;
						}

						.name {
							color: #616161;
						}
					}

					.input-item {
						display: flex;
						align-items: center;
					}

					.user-photo-block {
						width: 130rpx;
						height: 130rpx;
						border-radius: 50%;
						overflow: hidden;

						.upload-photo-btn {
							width: 100%;
							height: 100%;
							position: relative;
							padding: 0;

							.tips {
								width: 44rpx;
								position: absolute;
								bottom: 0;
								right: 30rpx;
								bottom: 10rpx;
								color: #fff;
								z-index: 1;
								height: 44rpx;
							}
						}

						.user-photo {
							width: 100%;
							height: 100%;
						}

						.user-photo.ps {
							position: absolute;
							left: 0;
							top: 0;

						}
					}

					.status {
						margin-left: 20rpx;
						background-color: #f0f9e8;
						color: #70c919;
						height: 54rpx;
						display: flex;
						align-items: center;
						justify-content: center;
						font-size: 28rpx;
						width: 120rpx;
						border-radius: 10rpx;
					}

					.text {
						font-size: 32rpx;
						display: flex;
						align-items: center;
					}
				}
			}

			.btn-item {
				display: flex;
				align-items: center;
				justify-content: center;
				margin-top: 50rpx;
			}
		}
	}
</style>